package com.yuhanginfo.modules.sys.service;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yuhanginfo.common.service.CrudService;
import com.yuhanginfo.modules.sys.entity.SysAddress;
import com.yuhanginfo.modules.sys.dao.SysAddressDao;

/**
 * 地址管理Service
 * @author lvls
 * @version 2017-11-22
 */
@Service
@Transactional(readOnly = true)
public class SysAddressService extends CrudService<SysAddressDao, SysAddress> {
     @Autowired
     private SysAddressDao addressDao;

	
	@Transactional(readOnly = false)
	public void save(SysAddress address) {
		super.save(address);
	}
	
	@Transactional(readOnly = false)
	public void delete(SysAddress address) {
		super.delete(address);
	}

	public List<SysAddress> selectByUseId(String userId) {
		
		return addressDao.selectByUseId(userId);
	}

	public SysAddress getDefAddress(SysAddress address) {
		
		return addressDao.getDefAddress(address);
	}

	public SysAddress selectByAddressId(String id) {
		
		return addressDao.selectByAddressId(id);
	}
	
}